.placeholder(@color: @input-placeholder-color) {
  // Firefox
  &::-moz-placeholder {
    color: @color;
    .opacity(1); // Override Firefox's unusual default opacity;
  }
  &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
  &::-webkit-input-placeholder  { color: @color; } // Safari and Chrome
}

.hover(@color: @input-hover-border-color) {
    border-color: tint(@color, 20%);
}
.hover-error(@error-color: @error-color) {
    border-color: @error-color;
}

.active(@color: @input-hover-border-color) {
    border-color: tint(@color, 20%);
    outline: 0;
    box-shadow: 0 0 0 2px fade(@color, 20%);
}
.active-error(@error-color: @error-color) {
    border-color: @error-color;
    outline: 0;
    box-shadow: 0 0 0 2px fade(@error-color, 20%);
}

.disabled() {
    background-color: @input-disabled-bg;
    .opacity(1);
    cursor: @cursor-disabled;
    color: #ccc;
    &:hover {
        .hover(@input-border-color);
    }
}

.input-large() {
    font-size: @font-size-base;
    padding: @input-padding-vertical-large @input-padding-horizontal;
    height: @input-height-large;
}

.input-small() {
    padding: @input-padding-vertical-small @input-padding-horizontal;
    height: @input-height-small;
    border-radius: @btn-border-radius-small;
}

.input-size(@padding; @font-size; @line-height; @border-radius) {
    padding: @padding;
    font-size: @font-size;
    line-height: @line-height;
    height: @line-height;
    border-radius: @border-radius;
}

.input() {
    display: inline-block;
    width: 100%;
    height: @input-height-base;
    line-height: @line-height-base;
    padding: @input-padding-vertical-base @input-padding-horizontal;
    font-size: @font-size-small;
    border: 1px solid @input-border-color;
    border-radius: @btn-border-radius;
    color: @input-color;
    background-color: @input-bg;
    background-image: none;
    position: relative;
    cursor: text;
    .transition();
    .placeholder();

    &:hover {
        .hover();
    }

    &:active {
        .active();
        box-shadow: none;
    }

    &:focus {
        .active();
    }

    &[disabled],
    fieldset[disabled] & {
        .disabled();
    }

    // Reset height for textarea
    textarea& {
        max-width: 100%;
        height: auto;
        vertical-align: bottom;
        font-size: @font-size-base;
    }

}

.input-error(@color: @error-color) {
    border: 1px solid @color;
    &:hover {
        .hover-error(@color);
    }
    &:focus {
        .active-error(@color);
    }
}